<?xml version="1.0" encoding="UTF-8"?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:p="http://primefaces.prime.com.tr/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:c="http://java.sun.com/jsp/jstl/core"
                template="./../templates/StaffTemplate.xhtml">

    <ui:define name="nav_menu">
        <p:menubar model="#{composeMessageManagedBean.staffMenuModel}"/>
    </ui:define>

    <ui:define name="content">
        <h:form>
        <f:view beforePhase="#{composeMessageManagedBean.initView}">
            <h:body>
                <p:messages id="statusMessages" redisplay="false" />
                <p:panel header="Message Details" >   

                    <h:panelGrid columns="2" cellspacing="2" cellpadding="9">    
                        <h:outputText id="labelTo" value="To" style="font-weight: bold" />

                        <h:outputText value="#{composeMessageManagedBean.message.receiver}" 
                                      id ="receiver" style="width:410px;" />

                        <h:outputText id="labelSubject" value="Subject" style="font-weight: bold" />
                        <p:inputText value="#{composeMessageManagedBean.message.subject}" 
                                     id ="msgSubject" style="width:410px;" />
                    </h:panelGrid>

                    <p:separator/>
                    <h:panelGrid columns="2" cellspacing="2" cellpadding="9">    
                        <h:outputText id="replyMsg" value="Reply to Message: " style="font-weight: bold;" rendered="${composeMessageManagedBean.aReply==true}" />
                        <h:outputText id="replyMsgDetail" escape="false" value="#{composeMessageManagedBean.message.message}" rendered="${composeMessageManagedBean.aReply==true}" />
                    </h:panelGrid>
                    <h:panelGrid columns="1" cellpadding="2"  cellspacing="9">

                        <h:column/>
                        <p:editor value="#{composeMessageManagedBean.replyMessage.message}" id ="eventDesc" />


                    </h:panelGrid>


                    <p:commandButton value="Send" actionListener="#{composeMessageManagedBean.saveMessage}" ajax="true" rendered="${composeMessageManagedBean.aReply==false}"/>
                    <p:commandButton value="Reply" actionListener="#{composeMessageManagedBean.replyMessage}" ajax="true" rendered="${composeMessageManagedBean.aReply==true}"/>
                    
                </p:panel>
                <p:ajaxStatus>  
                    <f:facet name="start">  
                        <h:graphicImage value="../design/ajaxloading.gif" />  
                    </f:facet>  

                    <f:facet name="complete">  
                        <h:outputText value="" />  
                    </f:facet>  
                </p:ajaxStatus> 
            </h:body>
        </f:view>
        </h:form>
    </ui:define>
</ui:composition>
